package com.flx.ark.spring.code.user.service;

import com.flx.ark.spring.code.user.pojo.SimpleUser;
import com.flx.ark.spring.code.user.property.UserProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;

/**
 * @Author: Fenglixiong
 * @Date: 2021/9/3 15:02
 * @Description:
 */
@Slf4j
public class UserService {

    @Autowired
    private UserProperties userProperties;

    public SimpleUser getUser(Long id){
        if(id==1){
            return new SimpleUser(1L,"jack");
        }else if(id==2){
            return new SimpleUser(2L,"marry");
        }else {
            return new SimpleUser(99L,"tommy");
        }
    }

    @PostConstruct
    public void init(){
        log.info("=====>UserService init..."+userProperties.getName());
    }

}
